//
//  HotListenListModel.m
//  NewMusic
//
//  Created by dllo on 15/11/16.
//  Copyright © 2015年 Going. All rights reserved.
//

#import "HotListenListModel.h"
#import "ListenDataSongsModel.h"
@implementation HotListenListModel
-(instancetype)initWithDictionary:(NSDictionary *)dictioary {
    self = [super init];
    if (self) {
        self.songs = [NSMutableArray array];
        self.image = [NSDictionary dictionary];
        self.owner = [NSDictionary dictionary];
        [self setValuesForKeysWithDictionary:dictioary];
    }
    return self;
}
-(void)setValue:(id)value forUndefinedKey:(NSString *)key {
    
}
-(void)setValue:(id)value forKey:(NSString *)key {
    if ([key isEqualToString:@"songlist_id"]) {
        self.songlist_id = [NSString stringWithFormat:@"%@", value];
    }else if ([key isEqualToString:@"song_count"]) {
        self.song_count = [NSString stringWithFormat:@"%@", value];
    }else if ([key isEqualToString:@"favorite_count"]) {
        self.favorite_count = [NSString stringWithFormat:@"%@", value];
    }else if ([key isEqualToString:@"share_count"]) {
        self.share_count = [NSString stringWithFormat:@"%@", value];
    }else if ([key isEqualToString:@"listen_count"]) {
        self.listen_count = [NSString stringWithFormat:@"%@", value];
    }else if ([key isEqualToString:@"type"]) {
        self.listen_count = [NSString stringWithFormat:@"%@", value];
    }else if ([key isEqualToString:@"songs"] ) {
        NSArray *array = (NSArray *)value;
        for (NSDictionary *dic in array) {
            ListenDataSongsModel *model = [[ListenDataSongsModel alloc]initWithDictionary:dic];
            [self.songs addObject:model];
            [model release];
        }
    }else {
        
        [super setValue:value forKey:key];
    }
}

@end
